<?php

/**
 * Candidate form.
 *
 * @package    lomejorde
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class CandidateForm extends BaseCandidateForm
{
    public function configure()
    {
        unset ($this['created_at'],$this['updated_at'],$this['thumb'],$this['image'],$this['twitter'],$this['facebook'],
            $this['address'],$this['email'],$this['web_page'],$this['categories_list'], $this['nominated_list'], $this['active']
        );
        
        $this->widgetSchema['name']->setAttributes(array('class' => 'span-5'));
        
        $this->widgetSchema['description']->setAttributes(array('class' => 'span-5'));
        
        $this->widgetSchema->setHelp('description','Por ejemplo: Dirección, página Web o una descripción');
        
        $this->widgetSchema->setLabels(array(
            'name' => 'Nombre',
            'description' => 'Referencia'
        ));
        
        $this->validatorSchema['name']->setMessages(array('required' => 'Campo requerido.'));
        
        $this->validatorSchema['description']->setOption('required', true);
        
        $this->validatorSchema['description']->setMessages(array('required' => 'Campo requerido.'));
        
        $this->widgetSchema->setFormFormatterName('candidate');
    }
}
